<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8" />
    <title>04_案例练习-打印2到100之间所有的质数</title>
</head>

<body>
    <script>
        for (var i = 2; i <= 100; i++) {


            var flag = true;
            for (var j = 2; j <= i / 2; j++) {
                if (i % j == 0) {
                    flag = false;
                    break;
                }
            }

            if (flag) {
                console.log(i + ':是质数');
            }



            
        }


    </script>
</body>

</html>